package com.bq.server.enumeration;

import com.bq.server.base.ErrorCode;
import lombok.Getter;

/**
 * 错误代码枚举
 *
 * @author: ChenSH
 * @date: Create by in 15:33 2019-09-20
 */
@Getter
public enum ErrorCodeEnum implements ErrorCode {


    /**
     * CODE 编码标识规范 :  20-01-01   20: 系统级别 01:模块级别 01: 具体错误信息
     */

    ERROR_CLIENT_ENUM_NOT_FOUND(100000, "{0}不在{1}范围"),

    ERROR_NOT_IMPLEMENTED_ENUMERATION(100001, "枚举{0}未实现 Enumeration 接口"),

    CLIENT_VALIDATION(100002, "请求参数验证错误"),

    DATA_NOT_FOUND(100004, "数据没找到[{0}]"),


    ERROR_QYWX_TOKEN(200001, "企业微信token获取失败"),

    ERROR_DING_TALK_TOKEN(200002, "钉钉token获取失败"),

    ERROR_DING_TALK(200003, "钉钉接口调用失败"),

    WECHAT_GET_USER_ID_ERROR(200004, "企业微信获取userId接口调用失败"),

    WECHAT_GET_USER_INFO_ERROR(200005, "企业微信获取用户信息接口调用失败"),

    WECHAT_GET_USER_NOT_FIND_ERROR(200006, "您不属于企业成员!"),



    /* 登录异常 */
    ERROR_NOT_LOGIN(400000, "用户未登录"),
    ERROR_LOGIN_USER_NOT_AUTHORIZE(400001, "用户无权访问该系统"),
    ERROR_LOGIN_USERNAME_OR_PASSWORD(400020, "用户名或密码错误"),

    ERROR_LOGIN_VERIFY_CODE(400021, "验证码错误"),

    ERROR_LOGIN_EXPIRED(400022, "登录已过期"),
    ERROR_LOGIN_NOT_EXISTS(400023, "用户名不存在"),
    ERROR_LOGIN_USERNAME_NULL(400024, "请输入用户名"),
    ERROR_LOGIN_PASSWORD_NULL(400025, "请输入密码"),
    ERROR_LOGIN_VERIFY_CODE_NULL(400026, "请输入验证码"),

    ERROR_LOGIN_SMS_TEMP_NULL(400027, "模板编码不存在"),
    ERROR_LOGIN_PHONE_NOT_FOUND(400028, "手机号没找到"),
    ERROR_LOGIN_PHONE_CODE_FAIL(400029, "验证码错误"),

    ERROR_LOGIN_EXTRA(400030, "登录失败"),
    ILLEGAL_SESSION_ID(400031, "非法sessionId"),

    ERROR_NOT_AUTH(400040, "您的权限不足"),

    /*员工,部门管理异常  200201~ */
    ERROR_CANNOT_DEL_EMPLOYEE(200201, "钉钉同步的员工数据不允许变更"),
    ERROR_CANNOT_DEL_DEPT(200202, "钉钉同步的部门数据不允许变更"),
    ERROR_DEPT_ISNULL(200203, "部门信息不存在"),
    ERROR_DEPTNAME_IS_EXIST(200204, "部门名称已存在"),
    ERROR_DEPTNAME_IS_NOT(200205, "部门名称必填"),
    ERROR_DEPTPARENTID_IS_NOT(200206, "父级部门id必填"),
    ERROR_DEPTID_IS_NOTNULL(200207, "部门id必填"),
    ERROR_UNIFIEDID_IS_NOTNULL(200208, "员工信息必填"),
    ERROR_EMPLOYEE_IS_NULL(200209, "员工信息不存在"),
    DEL_EMP_BEFORE_DEL_DEPT(200210, "需要先删除该部门下的员工，再删除该部门!"),
    ADD_SUPER_ADMIN_ERROR(200211, "您暂无权限添加角色为管理员的员工,请联系超级管理员添加"),
    UP_SUPER_ADMIN_ERROR(200212, "您暂无权限修改角色为管理员的员工,请联系超级管理员修改"),


    EMPLOYEE_NAME_ISNOT_NULL(200301, "登录账号必填"),
    EMPLOYEE_NAME_IS_EXISTS(200302, "登录账号已存在"),
    EMPLOYEE_PHONE_ISNOT_NULL(200303, "手机号不能为空"),
    EMPLOYEE_EMAIL_ISNOT_NULL(200304, "邮箱地址不能为空"),
    EMPLOYEE_PHONE_FORMAT_ERR(200305, "手机号格式不匹配"),
    EMPLOYEE_EMIL_FORMAT_ERR(200306, "邮箱格式不匹配"),
    EMPLOYEE_EMIL_IS_EXISTS(200307, "该邮箱已被使用"),
    EMPLOYEE_PHONE_IS_EXISTS(200308, "该手机号已被使用"),
    EMPLOYEE_NICKNAME_IS_EXISTS(200309, "该昵称已被使用"),
    EMPLOYEE_PASSWORD_IS_ERROR(200310, "密码格式不符合要求"),
    EMPLOYEE_PASSWORD_IS_NULL(200311, "很抱歉,您的账号暂时无法通过账号密码登录,请更换其他方式登录"),

    /* 子系统异常 */
    ERROR_SERVER_INFO_NOT_FOUND(200101, "暂无该系统的访问权限!"),
    ERROR_SERVER_INFO_DEL(200102, "删除失败!"),
    ERROR_SERVER_INFO_UP(200103, "修改失败!"),
    ERROR_SERVER_INFO_ADD(200104, "添加失败!"),
    ERROR_SERVER_INFO_NULL(200105, "当前系统信息不存在!"),
    ERROR_SERVER_URL(200106, "URL地址无效!"),
    ERROR_SERVER_URL_IS_NULL(200107, "URL地址不存在")
    /*微信授权异常*/,
    ERROR_SYS_PARAM_NOT_FOUND(200111, "当前参数配置不存在!"),
    ERROR_SECRET_NOT_FOUND(200112, "应用密钥信息异常!"),
    ERROR_GET_TOKEN(200114, "获取token信息异常!"),
    ERROR_USER_PLAT_NOT_FOUND(200113, "用户平台信息不存在!"),


    /*数据字典*/
    DICT_ITEM_KEY_VALIDATION(200201, "字段key重复"),

    ;

    private final Integer code;

    private final String describe;

    ErrorCodeEnum(Integer code, String describe) {
        this.code = code;
        this.describe = describe;
    }
}
